package yxy.game.pm2.module.union.rank;

import yxy.game.pm2.bean.ServerBean;
import yxy.game.pm2.bean.area.AreaBean;
import yxy.game.pm2.bean.module.rank.PlayerRankModule;

//按区内排行：联盟战力排行
public class RankAreaPowerUnion extends UnionAreaRankModule {

	public RankAreaPowerUnion(AreaBean areaBean) {
		super(areaBean);
	}

	@Override
	public String rankName() {
		return PlayerRankModule.getAllRankNames().get(8);
	}

	@Override
	protected long valuePlastic(long value) {
		return value * 10;
	}

	@Override
	protected long valueRestore(long score) {
		return score / 10;
	}

	static public RankAreaPowerUnion get(int serverId) {
		ServerBean serverBean = ServerBean.get(serverId);
		AreaBean areaBean = AreaBean.get(serverBean.getAreaId());
		if (areaBean == null) {
			return null;
		}
		return new RankAreaPowerUnion(areaBean);
	}
}
